//
//  SMAccountScrollCell.m
//  lishiminOC
//
//  Created by p2p on 16/10/14.
//  Copyright © 2016年 p2p. All rights reserved.
//

#import "SMAccountScrollCell.h"

@interface SMAccountScrollCell()
@property (nonatomic,strong)SMScrollView *scrollView;
@end
@implementation SMAccountScrollCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (instancetype)init{
    self = [super init];
    if (self) {
        //创建一个滚动视图
        [self setupUI];
    }
    return self;
}
#pragma mark - 创建一个滚动视图
- (void)setupUI{
    SMScrollView *scrollView = [[SMScrollView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreenWidth], 122)];
    self.scrollView = scrollView;
    scrollView.imgArray = [NSMutableArray arrayWithArray:@[@"n1",@"n2",@"n3",@"n4",@"n5",@"n6",@"n7",@"n8"]];
    [scrollView  touchImageIndexBlock:^(NSInteger index) {
        
        //        UBSubscribeActionVC *vc = [[UBSubscribeActionVC alloc]init];
        //        DealAccountBannerDO *model1 = self.myAccountBannerModelArray[index];
        //        NSString *url = model1.url;
        //        vc.urlStr = url;
        //        vc.btnName = @"活动";
        //        UBNaviVC *nvc = [[UBNaviVC alloc]initWithRootViewController:vc];
        //        [self presentViewController:nvc animated:YES completion:nil];
        //点击视图的方法
        NSLog(@"%ld",(long)index);
    }];
    [self addSubview:scrollView];
    
}
- (void)layoutSubviews{
//    __weak __typeof(&*self)weakSelf = self;
//    [self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
//        //
//        make.top.equalTo(weakSelf.mas_top);
//        make.bottom.equalTo(weakSelf.mas_bottom);
//        make.left.equalTo(weakSelf.mas_left);
//        make.right.equalTo(weakSelf.mas_right);
//    }];
}
@end
